import request, {postJson} from "@/apps/admin/utils/request.ts";

const SERVER = '/v1/admin';

export function addReservation(data) {
    return request.post(`${SERVER}/addReservation`, data, {
        headers: {
            'Content-Type': 'application/json'
        }
    });
}


export function getNotOutReservations(page, size, search = '') {
    return request.get(SERVER + `/getNotOutReservations?page=${page}&size=${size}&search=${search}`);
}
export function getReservations(type, page, size, search = '') {
    return request.get(SERVER + `/getReservations?type=${type}&page=${page}&size=${size}&search=${search}`);
}

// 获取未审核的
export const getReservationsByNotReview = (type, page, size, search) => {
    return request.get(`${SERVER}/getReservationsByNotReview?type=${type}&page=${page}&size=${size}&search=${search}`);
}

export const approveReservationApi = (data) => {
    return postJson(`${SERVER}/approveReservation`, data);
}

export const rejectReservationApi = (data) => {
    return postJson(`${SERVER}/rejectReservation`, data);
}
